//地图骑行
import React, { Component } from 'react';
import {
    View,
    Text,
} from 'react-native';


import { mapbicycleStyle as styles } from '../../../styles';
import Bicycle_route from './bicycleroute';

var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;


export default class Mapbicycle extends Component {
    constructor(props) {
        super(props)
    }

    render() {
        return (
            <View style={{flex:1}}>
                <View style={styles.bicycletext}>
                    <Text style={styles.bicycletime}>{this.props.Lines[0]?(this.props.Lines[0].duration/60).toFixed(0):null}分钟</Text>
                    <Text style={styles.bicycletime}>{this.props.Lines[0]?(this.props.Lines[0].distance/1000).toFixed(1):null}公里</Text>
                </View>

                <Text style={styles.gomore}>路线详情</Text>
                {this.props.Lines[0]?
                <Bicycle_route Line={this.props.Lines[0]} isPassDay={(this.props.Lines[0].duration/360)>24?true:false}/>:
                <Text>木有线路</Text>}
            </View>
        )
    }

}